package com.kehutong.work.order.manage.entity;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;
import org.coraframework.orm.util.IDType;
import org.coraframework.util.Objects;
import com.kehutong.common.entity.DataEntity;
import com.kehutong.work.order.manage.enums.DoorToDoorEnum;
import com.kehutong.work.order.manage.enums.EmergencyStateEnum;
import com.kehutong.work.order.manage.enums.WorkOrderStateEnum;

@Table(value="t_work_order_manage", comment="工单", multi=true, idType = IDType.TIMESTAMP,isSyncGenerateTable=true)
public class WorkOrderManage extends DataEntity {

    private static final long serialVersionUID = 7203239375330301968L;

    protected WorkOrderManage(String id) {
        super(id);
    }

    @Column(comment="工单标题")
    private String name;

    @Column(comment="小区编号")
    private String communityNo;

    @Column(comment="小区名称")
    private String communityName;

    @Column(comment="房子ID")
    private String houseNo;

    @Column(comment="楼栋ID")
    private String buildNo;

    @Column(comment="房子名称")
    private String houseName;

    @Column(comment="类型ID")
    private String typeNo;

    @Column(comment="类型名称")
    private String typeName;

    @Column(comment="一级分类ID")
    private String oneClassifyNo;

    @Column(comment="一级分类名称")
    private String oneClassifyName;

    @Column(comment="二级分类ID")
    private String twoClassifyNo;

    @Column(comment="二级分类名称")
    private String twoClassifyName;

    @Column(comment="内容", dbType = "TEXT", length = 65535)
    private String content;

    @Column(comment="图片列表")
    private List<String> imgIds;

    @Column(comment = "发生地点", length = 72)
    private String address;

    @Column(comment = "省编码")
    private String provinceCode;

    @Column(comment = "市编码")
    private String cityCode;

    @Column(comment = "区编码")
    private String districtCode;

    @Column(comment = "坐标系标注")
    private String coordinateSystem;

    @Column(comment = "发生地点，详细地址", length = 72)
    private String addressDetail;

    @Column(comment = "经度")
    private String lng;

    @Column(comment = "纬度")
    private String lat;

    @Column(comment = "处理人员ID")
    private List<String> handleEmployeeNo;

    @Column(comment = "处理人员名字")
    private List<String> handleEmployeeName;

    @Column(comment = "处理人员部门")
    private List<String> handleDepartName;

    @Column(comment = "提交给我的ID")
    private List<String> submitToMeNo;

    @Column(comment = "提交给我的名字")
    private List<String> submitToMeName;

    @Column(comment="紧急状态")
    private EmergencyStateEnum emergency;

    @Column(comment="上门服务")
    private DoorToDoorEnum doorToDoor;

    @Column(comment = "上门服务预约开始时间")
    private String doorToDoorStartTime;

    @Column(comment = "上门服务预约结束时间")
    private String doorToDoorEndTime;

    @Column(comment = "通知人员ID")
    private List<String> noticeEmployeeNo;

    @Column(comment = "通知人员名字")
    private List<String> noticeEmployeeName;

    @Column(comment = "工单状态")
    private WorkOrderStateEnum workOrderState;

    @Column(comment = "提交人员ID")
    private String createUserNo;

    @Column(comment = "提交人员名字")
    private String createUserName;

    @Column(comment = "提交人员部门ID")
    private String createUserDepart;

    @Column(comment = "提交人员部门名称")
    private String createUserDepartName;

    @Column(comment = "办结时间")
    private LocalDateTime finishTime;

    @Column(comment = "逻辑删除")
    private boolean deleted;

    @Column(comment = "用户评价")
    private boolean userAppraisal;

    @Column(comment = "当前工单记录ID")
    private String recordId;

    @Column(comment = "是否用户发起的工单")
    private boolean userCreate;

    @Column(comment = "是否签到")
    private boolean signIn;

    @Column(comment = "最后签到地址", length = 144)
    private String signInAddress;

    @Column(comment = "最后签到经度")
    private String signInLng;

    @Column(comment = "最后签到纬度")
    private String signInLat;

    @Column(comment = "发起人手机号")
    private String createPhone;
    @Column(comment = "处理人岗位名称", length = 255)
    private String handlePositionTitle;
    @Column(comment = "创建人头像", length = 255)
    private String avatar;

    @Column(comment = "工单权限人", dbType = "TEXT")
    private List<String> authorityUserList;

    @UnSave
    private List<WorkOrderManageRecord> recordList;
    // 退回上一个员工编号
    @UnSave
    private String returnableEmployeeNo;
    @UnSave
    private String returnableEmployeeName;
    // 当前登录人是否是创建人
    @UnSave
    private boolean tokenUserCreate;
    // 当前登录人是否是处理人
    @UnSave
    private boolean tokenUserHandle;
    // 通用附件列表
    @UnSave
    private List<String> fileList;

    private String companyNo;

    private String username;


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCommunityNo() {
        return communityNo;
    }

    public void setCommunityNo(String communityNo) {
        this.communityNo = communityNo;
    }

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    public String getTypeNo() {
        return typeNo;
    }

    public void setTypeNo(String typeNo) {
        this.typeNo = typeNo;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getOneClassifyNo() {
        return oneClassifyNo;
    }

    public void setOneClassifyNo(String oneClassifyNo) {
        this.oneClassifyNo = oneClassifyNo;
    }

    public String getOneClassifyName() {
        return oneClassifyName;
    }

    public void setOneClassifyName(String oneClassifyName) {
        this.oneClassifyName = oneClassifyName;
    }

    public String getTwoClassifyNo() {
        return twoClassifyNo;
    }

    public void setTwoClassifyNo(String twoClassifyNo) {
        this.twoClassifyNo = twoClassifyNo;
    }

    public String getTwoClassifyName() {
        return twoClassifyName;
    }

    public void setTwoClassifyName(String twoClassifyName) {
        this.twoClassifyName = twoClassifyName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getImgIds() {
        if (Objects.isEmpty(imgIds)) {
            return new ArrayList<>();
        }
        return imgIds;
    }

    public void setImgIds(List<String> imgIds) {
        this.imgIds = imgIds;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public List<String> getHandleEmployeeNo() {
        if (Objects.isEmpty(handleEmployeeNo)) {
            return new ArrayList<>();
        }
        return handleEmployeeNo;
    }

    public void setHandleEmployeeNo(List<String> handleEmployeeNo) {
        this.handleEmployeeNo = handleEmployeeNo;
    }

    public List<String> getHandleEmployeeName() {
        if (Objects.isEmpty(handleEmployeeName)) {
            return new ArrayList<>();
        }
        return handleEmployeeName;
    }

    public void setHandleEmployeeName(List<String> handleEmployeeName) {
        this.handleEmployeeName = handleEmployeeName;
    }

    public List<String> getSubmitToMeNo() {
        if (Objects.isEmpty(submitToMeNo)) {
            return new ArrayList<>();
        }
        return submitToMeNo;
    }

    public void setSubmitToMeNo(List<String> submitToMeNo) {
        this.submitToMeNo = submitToMeNo;
    }

    public List<String> getSubmitToMeName() {
        if (Objects.isEmpty(submitToMeName)) {
            return new ArrayList<>();
        }
        return submitToMeName;
    }

    public void setSubmitToMeName(List<String> submitToMeName) {
        this.submitToMeName = submitToMeName;
    }

    public EmergencyStateEnum getEmergency() {
        return emergency;
    }

    public void setEmergency(EmergencyStateEnum emergency) {
        this.emergency = emergency;
    }

    public DoorToDoorEnum getDoorToDoor() {
        return doorToDoor;
    }

    public void setDoorToDoor(DoorToDoorEnum doorToDoor) {
        this.doorToDoor = doorToDoor;
    }

    public String getDoorToDoorStartTime() {
        return doorToDoorStartTime;
    }

    public void setDoorToDoorStartTime(String doorToDoorStartTime) {
        this.doorToDoorStartTime = doorToDoorStartTime;
    }

    public String getDoorToDoorEndTime() {
        return doorToDoorEndTime;
    }

    public void setDoorToDoorEndTime(String doorToDoorEndTime) {
        this.doorToDoorEndTime = doorToDoorEndTime;
    }

    public List<String> getNoticeEmployeeNo() {
        if (Objects.isEmpty(noticeEmployeeNo)) {
            return new ArrayList<>();
        }
        return noticeEmployeeNo;
    }

    public boolean isUserCreate() {
        return userCreate;
    }

    public void setNoticeEmployeeNo(List<String> noticeEmployeeNo) {
        this.noticeEmployeeNo = noticeEmployeeNo;
    }

    public List<String> getNoticeEmployeeName() {
        if (Objects.isEmpty(noticeEmployeeName)) {
            return new ArrayList<>();
        }
        return noticeEmployeeName;
    }

    public void setNoticeEmployeeName(List<String> noticeEmployeeName) {
        this.noticeEmployeeName = noticeEmployeeName;
    }

    public WorkOrderStateEnum getWorkOrderState() {
        return workOrderState;
    }

    public void setWorkOrderState(WorkOrderStateEnum workOrderState) {
        this.workOrderState = workOrderState;
    }

    public String getCreateUserNo() {
        return createUserNo;
    }

    public void setCreateUserNo(String createUserNo) {
        this.createUserNo = createUserNo;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public LocalDateTime getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(LocalDateTime finishTime) {
        this.finishTime = finishTime;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public boolean isUserAppraisal() {
        return userAppraisal;
    }

    public void setUserAppraisal(boolean userAppraisal) {
        this.userAppraisal = userAppraisal;
    }

    public String getRecordId() {
        return recordId;
    }

    public void setRecordId(String recordId) {
        this.recordId = recordId;
    }




    public void setUserCreate(boolean userCreate) {
        this.userCreate = userCreate;
    }

    public boolean isSignIn() {
        return signIn;
    }

    public void setSignIn(boolean signIn) {
        this.signIn = signIn;
    }

    public List<WorkOrderManageRecord> getRecordList() {
        if (Objects.isEmpty(recordList)) {
            return new ArrayList<>();
        }
        return recordList;
    }

    public void setRecordList(List<WorkOrderManageRecord> recordList) {
        this.recordList = recordList;
    }

    public String getCreateUserDepart() {
        return createUserDepart;
    }

    public void setCreateUserDepart(String createUserDepart) {
        this.createUserDepart = createUserDepart;
    }

    public String getCreateUserDepartName() {
        return createUserDepartName;
    }

    public void setCreateUserDepartName(String createUserDepartName) {
        this.createUserDepartName = createUserDepartName;
    }

    public String getHouseNo() {
        return houseNo;
    }

    public void setHouseNo(String houseNo) {
        this.houseNo = houseNo;
    }

    public List<String> getHandleDepartName() {
        if (Objects.isEmpty(handleDepartName)) {
            return new ArrayList<>();
        }
        return handleDepartName;
    }

    public void setHandleDepartName(List<String> handleDepartName) {
        this.handleDepartName = handleDepartName;
    }

    public String getReturnableEmployeeNo() {
        return returnableEmployeeNo;
    }

    public void setReturnableEmployeeNo(String returnableEmployeeNo) {
        this.returnableEmployeeNo = returnableEmployeeNo;
    }

    public String getSignInAddress() {
        return signInAddress;
    }

    public void setSignInAddress(String signInAddress) {
        this.signInAddress = signInAddress;
    }

    public String getHouseName() {
        return houseName;
    }

    public void setHouseName(String houseName) {
        this.houseName = houseName;
    }

    public String getAddressDetail() {
        return addressDetail;
    }

    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }

    public String getReturnableEmployeeName() {
        return returnableEmployeeName;
    }

    public void setReturnableEmployeeName(String returnableEmployeeName) {
        this.returnableEmployeeName = returnableEmployeeName;
    }

    public boolean isTokenUserCreate() {
        return tokenUserCreate;
    }

    public void setTokenUserCreate(boolean tokenUserCreate) {
        this.tokenUserCreate = tokenUserCreate;
    }

    public boolean isTokenUserHandle() {
        return tokenUserHandle;
    }

    public void setTokenUserHandle(boolean tokenUserHandle) {
        this.tokenUserHandle = tokenUserHandle;
    }

    public String getCreatePhone() {
        return createPhone;
    }

    public void setCreatePhone(String createPhone) {
        this.createPhone = createPhone;
    }

    public String getBuildNo() {
        return buildNo;
    }

    public void setBuildNo(String buildNo) {
        this.buildNo = buildNo;
    }

    public String getHandlePositionTitle() {
        return handlePositionTitle;
    }

    public void setHandlePositionTitle(String handlePositionTitle) {
        this.handlePositionTitle = handlePositionTitle;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getSignInLng() {
        return signInLng;
    }

    public void setSignInLng(String signInLng) {
        this.signInLng = signInLng;
    }

    public String getSignInLat() {
        return signInLat;
    }

    public void setSignInLat(String signInLat) {
        this.signInLat = signInLat;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getDistrictCode() {
        return districtCode;
    }

    public void setDistrictCode(String districtCode) {
        this.districtCode = districtCode;
    }

    public String getCoordinateSystem() {
        return coordinateSystem;
    }

    public void setCoordinateSystem(String coordinateSystem) {
        this.coordinateSystem = coordinateSystem;
    }

    public List<String> getAuthorityUserList() {
        if (Objects.isEmpty(authorityUserList)) {
            return new ArrayList<>();
        }
        return authorityUserList;
    }

    public void setAuthorityUserList(List<String> authorityUserList) {
        this.authorityUserList = authorityUserList;
    }

    public List<String> getFileList() {
        return fileList;
    }

    public void setFileList(List<String> fileList) {
        this.fileList = fileList;
    }
}
